package com.bestow.basic.service.impl;

import java.util.List;

import com.bestow.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bestow.basic.mapper.HlsBpRelationMapper;
import com.bestow.basic.domain.HlsBpRelation;
import com.bestow.basic.service.IHlsBpRelationService;

/**
 * 商业伙伴关系Service业务层处理
 *
 * @author liliu
 * @date 2022-09-28
 */
@Service
public class HlsBpRelationServiceImpl extends ServiceImpl<HlsBpRelationMapper, HlsBpRelation> implements IHlsBpRelationService {
    @Autowired
    private HlsBpRelationMapper hlsBpRelationMapper;

    /**
     * 查询商业伙伴关系
     *
     * @param bpRelationType 商业伙伴关系主键
     * @return 商业伙伴关系
     */
    @Override
    public HlsBpRelation selectHlsBpRelationByBpRelationType(String bpRelationType) {
        return hlsBpRelationMapper.selectHlsBpRelationByBpRelationType(bpRelationType);
    }

    /**
     * 查询商业伙伴关系列表
     *
     * @param hlsBpRelation 商业伙伴关系
     * @return 商业伙伴关系
     */
    @Override
    public List<HlsBpRelation> selectHlsBpRelationList(HlsBpRelation hlsBpRelation) {
        return hlsBpRelationMapper.selectHlsBpRelationList(hlsBpRelation);
    }

    /**
     * 新增商业伙伴关系
     *
     * @param hlsBpRelation 商业伙伴关系
     * @return 结果
     */
    @Override
    public int insertHlsBpRelation(HlsBpRelation hlsBpRelation) {
        hlsBpRelation.setCreateTime(DateUtils.getNowDate());
        return hlsBpRelationMapper.insertHlsBpRelation(hlsBpRelation);
    }

    /**
     * 修改商业伙伴关系
     *
     * @param hlsBpRelation 商业伙伴关系
     * @return 结果
     */
    @Override
    public int updateHlsBpRelation(HlsBpRelation hlsBpRelation) {
        hlsBpRelation.setUpdateTime(DateUtils.getNowDate());
        return hlsBpRelationMapper.updateHlsBpRelation(hlsBpRelation);
    }

    /**
     * 批量删除商业伙伴关系
     *
     * @param bpRelationTypes 需要删除的商业伙伴关系主键
     * @return 结果
     */
    @Override
    public int deleteHlsBpRelationByBpRelationTypes(String[] bpRelationTypes) {
        return hlsBpRelationMapper.deleteHlsBpRelationByBpRelationTypes(bpRelationTypes);
    }

    /**
     * 删除商业伙伴关系信息
     *
     * @param bpRelationType 商业伙伴关系主键
     * @return 结果
     */
    @Override
    public int deleteHlsBpRelationByBpRelationType(String bpRelationType) {
        return hlsBpRelationMapper.deleteHlsBpRelationByBpRelationType(bpRelationType);
    }
}
